//
//  PopMoreTableViewCell.m
//  SugarPile
//
//  Created by Charlie. on 16/1/28.
//  Copyright © 2016年 www.lanou39.蓝鸥科技. All rights reserved.
//

#import "PopMoreTableViewCell.h"

@interface PopMoreTableViewCell ()
@property (nonatomic, retain) UILabel *title; /**<标题*/
@property (nonatomic, retain) UIImageView *urlImage; /**<图片*/
@end
@implementation PopMoreTableViewCell


-(void)dealloc
{
    [_title release];
    [_urlImage release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // 标题
        self.title = [[UILabel alloc] init];
        [self.title release];
        [self.contentView addSubview:_title];
//        _title.backgroundColor = [UIColor seaGreen];
        //图片
        self.urlImage = [[UIImageView alloc] init];
//        _title.backgroundColor = [UIColor waterPink];
        [self.contentView addSubview:_urlImage];
        [self.urlImage release];
    }
    return self;
}
- (void)setModel:(PopMoreModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
        
        self.title.frame = CGRectMake(10 * W, 20 * H, 150 * W, 30 * H);
        self.title.text = _model.title;
        
        
        self.urlImage.frame = CGRectMake(WIDTH - 60 * W, 10 * H, 50 * W, 50 * W);
        [self.urlImage sd_setImageWithURL:[NSURL URLWithString:_model.image_url]];
    }
}
-(void)layoutSubviews
{
    [super layoutSubviews];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
